solve issue 1619 (add texture-compression formats)#1621
Merged
Conversation
Member
|
Thanks for your contribution, Toni! |
Contributor
Author
|
The BC4 and BC5 image colour issue is maybe expected. Since they store the colour info on the red or the red-green channel respectively. But I'm unsure that do we need to use some swizzle or handle this in a shader separately? I don't have enough knowledge on the use cases or whatnots on RGTC textures. |
Member
|
How about providing test app(s) for this feature? |
Contributor
Author
I can try to create similar to TestLoadKtx.java. Should be sufficient. Convert the monkey texture with Compressonator. |
Contributor
Author
|
Pushed a similar (but slightly refined :D ) test that I used to test these files. It includes a sample from all the BCx formats that are loaded with DDS file format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1619
This PR adds support for BPTC compressed textures. Namely BC6 and BC7 compressed formats. Earlier, BC1-BC5 formats were already somewhat supported, that support is now enhanced a bit by making the DDS loader support them more widely. The file format varies widely, both DX9(?) style and the DX10 style files are supported for both BPTC and RGTC (BC4, BC5) compressed textures.
The BPTC was mainlined in OpenGL 4.2. I put the constants to the EXT instead and check the capability from both the OpenGL version and the extension. There wasn't a file for GL4.2, so I didn't create one as I was little unsure how to integrate that. Therefore the GLExt houses these new constants. The version + extension checking I hope to make sure we utilize the feature even if the graphics driver doesn't give out all capabilities properly. Doesn't cost a thing...
There are some caveats. Support for flipping textures is limited. Not implemented at all for BC6 nor BC7. This is said to be extremely difficult but maybe not impossible. I can create a ticket for these flip issues.
Here is a report of findings of these formats (I used Compressonator to create these, the file formats vary wildly it seems):